home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / catch.n < prev    next >
Encoding:
Text File  |  1994-12-17  |  1.5 KB  |  41 lines

  1. '\"
  2. '\" Copyright (c) 1993-1994 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) catch.n 1.3 94/12/17 16:17:42
  9. '\" 
  10. .so man.macros
  11. .HS catch tcl
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. catch \- Evaluate script and trap exceptional returns
  16. .SH SYNOPSIS
  17. \fBcatch\fI script \fR?\fIvarName\fR?
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. The \fBcatch\fR command may be used to prevent errors from aborting
  23. command interpretation.  \fBCatch\fR calls the Tcl interpreter recursively
  24. to execute \fIscript\fR, and always returns a TCL_OK code, regardless of
  25. any errors that might occur while executing \fIscript\fR.  The return
  26. value from \fBcatch\fR is a decimal string giving the
  27. code returned by the Tcl interpreter after executing \fIscript\fR.
  28. This will be \fB0\fR (TCL_OK) if there were no errors in \fIscript\fR;
  29. otherwise
  30. it will have a non-zero value corresponding to one of the exceptional
  31. return codes (see tcl.h for the definitions of code values).  If the
  32. \fIvarName\fR argument is given, then it gives the name of a variable;
  33. \fBcatch\fR will set the variable to the string returned
  34. from \fIscript\fR (either a result or an error message).
  35. .PP
  36. Note that \fBcatch\fR catches all exceptions, including those
  37. generated by \fBbreak\fR and \fBcontinue\fR as well as errors.
  38.  
  39. .SH KEYWORDS
  40. catch, error
  41.